/**
 * Project: lionbule-other
 * 
 * File Created at 2012-4-1
 * $Id$
 * 
 * Copyright 1999-2100 Alibaba.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.poi;

import java.util.ArrayList;
import java.util.List;

/**
 * Node.
 * 
 * @author LionBule 2012-4-1 下午7:49:27
 */
public class Node {
    private int    id;
    private int    level;
    private int    pid;
    private Node   parent;

    private String name;
    private String code;

    private String desc;

    public String toString() {
        return "{name=" + name + ", code=" + code + ", pid=" + pid + "}";
    }

    List<Node> childNodes = new ArrayList<Node>();

    public boolean isLeaf() {
        return childNodes.isEmpty();
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public List<Node> getChildNodes() {
        return childNodes;
    }

    public void addChildNode(Node child) {
        childNodes.add(child);
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public Node getParent() {
        return parent;
    }

    public void setParent(Node parent) {
        this.parent = parent;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
